package test;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import com.huiren.bean.PurOrder;
import com.huiren.mapper.PurOrderMapper;
import com.huiren.service.PurOrderService;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {
		"classpath:conf/spring/application-webservice.xml",
		"classpath:conf/spring/application-dataSource.xml",
		"classpath:conf/spring/application-common.xml",
		"classpath:conf/spring/application-service.xml" })
public class PurOrderSerivce extends AbstractJUnit4SpringContextTests {

	@Autowired
	private PurOrderService purOrderServiceImpl;
	@Autowired
	private PurOrderMapper purOrderMapper;

	@Test
	public void testPurOrderService() {

		try {
			purOrderServiceImpl.insertFromNet();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}

	// @Test
	public void test() {
		PurOrder purOrder = new PurOrder();
		purOrder.setPlan_id("22");
		purOrder.setCreate_date("2012-11-22");
		purOrder.setConstract_code("22222");
		purOrder.setLocal_product_id("2222222");
		purOrder.setMedical_manu("222");
		purOrder.setMedical_name("2222");
		purOrder.setMedical_spec("2323");
		purOrder.setLot_no("222");
		purOrder.setDate_insure("222");
		purOrder.setReceive_qty("33");
		purOrder.setWarhouse_id("222");
		purOrder.setCode_id("test");
		purOrder.setOrg_abbr_name("test");
		purOrder.setUnit_price("222");
		purOrder.setRetail_price("33");
		purOrder.setSend_lot("343");
		purOrder.setStorageid("3232");
		purOrder.setPlan_code("22");
		purOrder.setIsok(0);

		try {
			purOrderMapper.insert(purOrder);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}
